# src/config/cors.py
from fastapi.middleware.cors import CORSMiddleware


def setup_cors(app):
    """跨域配置"""
    app.add_middleware(
        CORSMiddleware,
        allow_origins=["*"],  # 生产环境替换为具体域名
        allow_methods=["GET", "POST", "PUT", "DELETE"],
        allow_headers=["*"],
    )
